from flask import Flask


class AppFactory(object):
    app = None

    @classmethod
    def create(cls):
        app = Flask(__name__)
        app.config.from_object('config')
        return app

    @classmethod
    def get_app(cls):
        if not cls.app:
            cls.app = cls.create()
        return cls.app
